// 管理服务器图片的仓库
import { requestGetNT } from "../utils/Request.js";
export default ({
    namespaced:true,
    state: {
        swiperImages:[],
        classify:[
            {
                icon:'gift',
                title:'日用品'
            },
            {
                icon:'printer',
                title:'电器'
            },
            {
                icon:'photograph',
                title:'电子产品'
            },
            {
                icon:'points',
                title:'食品'
            },
            {
                icon:'closed-eye',
                title:'服装'
            },
            {
                icon:'envelop-o',
                title:'箱包'
            },
            {
                icon:'audio',
                title:'文具'
            },
            {
                icon:'newspaper-o',
                title:'图书'
            },
        ]
    },
    mutations: {
        getSwiper(state,playload){
            for (let i = 0; i < playload.data.result.length; i++) {
                state.swiperImages[i]=playload.data.result[i].s_photos[0].path
            }
        }        
    },
    actions: {
        async getSwiper({commit},playload){
            const data=await requestGetNT(playload)
            commit('getSwiper',data)
        }
    },
})